package cn.wolfcode.qo;

import cn.hutool.core.date.DateUtil;
import cn.wolfcode.enums.ConsumptionReportEnum;
import cn.wolfcode.enums.ConsumptionStatusEnum;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Getter
@Setter
public class ConsumptionReportQueryObject extends QueryObject {
    private String groupType = ConsumptionReportEnum.BUSINESS.getValue();
    private Long businessId;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date beginDate;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date endDate;
    private Boolean appointmentAno;

    public Date getEndDate() {
        if (endDate != null) {
            return DateUtil.endOfDay(endDate);
        }
        return null;
    }
}
